#include"BinaryTree.h"

bool IsUnivalTree(BTNode* root)
{
	if (root == NULL)
	{
		return false;
	}
	if (root->left && root->left->data != root->data)
	{
		return false;
	}
	if (root->right && root->right->data != root->data)
	{
		return false;
	}
	return IsUnivalTree(root->left) && IsUnivalTree(root->right);
}

int main()
{
	BTNode* root = CreatBinaryTree();
	printf("%d\n", IsUnivalTree(root));
	BinaryTreeDestroy(root);
}